package com.fingard.dsp.bank.reqrespobj.relationdn;

import com.fingard.dsp.bank.reqrespobj.ReqRespHeader;
import com.fingard.dsp.bank.reqrespobj.RetAtsBase;
import com.fingard.dsp.bank.reqrespobj.relationdn.detail.RetAtsRelationDNDetail;
import com.fingard.xml.XmlTextWriter;

//响应对象

public class RetAtsRelationDN extends RetAtsBase {

    public String BankCode;
    public String Entity;
    public String TransType;
    public String TransSeqID;
    public String BatRespCode;
    public String BatRespInfo;

    public String RespCode;
    public String RespInfo;
    public String OprtNo;
    public String EntIdNo;
    public String CifNo;
    public String CifName;
    public String UserId;
    public String UserName;
    public String DnVar;
    public String Extend;




    public RetAtsRelationDN(ReqRespHeader reqHeader) {
        retHeader = reqHeader;
        retXmlWriter = new XmlTextWriter();
    }

    public void writeRetDetail(RetAtsRelationDNDetail p_req,boolean p_isBatch) throws Exception {
        if(p_isBatch){
            if(!hasWrittenRespCode){
                writeRespCode("0");
            }
            if(!hasWrittenRespInfo){
                writeRespInfo("");
            }
            retXmlWriter.writeStartElement("DetailRecord");
        }

        //接收银行返回的报文数据
        retXmlWriter.writeElementString("RespCode", p_req.RespCode);
        retXmlWriter.writeElementString("RespInfo", p_req.RespInfo);
        retXmlWriter.writeElementString("cifNo", p_req.cifNo);
        retXmlWriter.writeElementString("cifName", p_req.cifName);
        retXmlWriter.writeElementString("entIdNo", p_req.entIdNo);
        retXmlWriter.writeElementString("userId", p_req.userId);
        retXmlWriter.writeElementString("userName", p_req.userName);
        retXmlWriter.writeElementString("dnVar", p_req.dnVar);
        retXmlWriter.writeElementString("Extend", p_req.extend);


        if(p_isBatch){
            retXmlWriter.writeEndElement();
        }
    }



    public void writeAfterDetail() throws Exception {
        writeEnd();//写结束
    }


}
